import {CREATE_SIP, SET_SIP_CALL_TIME, SET_SIP_MESSAGE, SET_SIP_VISIBLE_OPERATION} from './constant'

// 定义reducer
export default function reducer(state: any, action: any) {
  switch (action.type) {
    case CREATE_SIP:
      return {...state, sipClient: action.data}

    case SET_SIP_MESSAGE:
      return {...state, sipMessage: action.data}

    case SET_SIP_CALL_TIME:
      return {...state, sipCallTime: action.data}

    case SET_SIP_VISIBLE_OPERATION:
      return {...state, visibleOperation: action.data}
    default:
      return state
  }
}
